<!--单行文本-->
<template>
  <el-input
    v-model="value"
    @clear="mySubmit"
    :id="'c' + controlId"
    :name="'c' + controlId"
    :size="size"
    :clearable="clearable"
    :validate_event="validate_event"
    :show-word-limit="show_word_limit"
  >
  </el-input>
</template>

<script >
  import { defineComponent } from 'vue'
  // 引入组件需要的属性 引入表单子控件的管理类
  // eslint-disable-next-line import/no-absolute-path
  import { baseProps, controlItemManage } from '/nf-control-web'

  export default defineComponent({
    name: 'el-form-item-text',
    props: {
      model: Object, // 整个model对象
      modelKey: String, // 使用model里的哪个属性
      ...baseProps, // 基础属性
      modelValue: [String, Array, Number]
    },
    emits: ['update:modelValue', 'my-change'],
    setup (props, context) {
      console.log('props-text', props)
      // console.log('props-ctx', context)
      const {
        value,
        mySubmit
      } = controlItemManage(props, context) // value、mySubmit

      return {
        value,
        mySubmit
      }
    }
  })
</script>
